rem @echo off  
rem 输出当前工作目录  
echo %cd%  

echo ******************************

rem Qt部署程序路径
SET WINDEPLOYQT_EXE=C:\Qt\Qt5.14.2\5.14.2\mingw73_64\bin\windeployqt.exe

SET APP_EXE=build-QtSerialMonitor-Desktop_Qt_5_14_2_MinGW_64_bit-Debug\debug\QtSerialMonitor.exe

rem 创建软件目录
mkdir softBin64
rem 复制软件文件
copy /Y %APP_EXE% softBin64\
rem 判断QT部署程序是否存在
if not exist %WINDEPLOYQT_EXE% (
	echo "WINDEPLOYQT_EXE NOT EXIST "%WINDEPLOYQT_EXE%
	pause
	exit
)

rem 使用QT部署程序打包QT依赖项
%WINDEPLOYQT_EXE% softBin64\QtSerialMonitor.exe 

copy /Y C:\Qt\Qt5.14.2\5.14.2\mingw73_64\bin\libgcc_s_seh-1.dll softBin64\
copy /Y "C:\Qt\Qt5.14.2\5.14.2\mingw73_64\bin\libstdc++-6.dll" softBin64\
copy /Y "C:\Qt\Qt5.14.2\5.14.2\mingw73_64\bin\libwinpthread-1.dll" softBin64\



rem %WINDEPLOYQT_EXE% softBin64\QtSerialMonitor.exe --qmldir C:\Qt\Qt5.14.2\5.14.2\mingw73_64\qml

if %errorlevel%==0 (
	echo "CPOPY QT LIBS SUCCEEDD"
)else (
	echo "CPOPY QT LIBS FAIL"
	pause
	exit
)


echo ##############
pause
exit


